package interfaces.inputValidation;

import java.util.ArrayList;
import java.util.List;

public class InputCheckContainer {
	
	protected List<InputChecker> inputCheckers;
	
	public InputCheckContainer(InputChecker... checkers) {
		inputCheckers = new ArrayList<InputChecker>();
		
		for(InputChecker c : checkers) {
			inputCheckers.add(c);
		}
	}
	
	public String check(String input) {
		for(InputChecker c : inputCheckers) {
			if(!c.isValid(input)) return c.getDescription();
		}
		
		return null;
	}
}